home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_01
/
9n01060a
< prev
next >
Wrap
Text File
|
1990-11-14
|
622b
|
33 lines
/* ************************************************ */
/* Demonstration of technique for multi-threading C */
#define NULL 0
main()
{
extern case0(), case1(), case2() ;
thread( case0, case1, case2, NULL) ;
}
int case0()
{
printf("** First thread part 1 ** ) ;
threadswitch() ;
printf("** First thread part 2 ** ) ;
}
int case1()
{
printf("** Second thread part 1 ** ) ;
threadswitch() ;
printf("** Second thread part 2 ** ) ;
}
int case2()
{
printf("** Third thread part 1 ** ) ;
threadswitch() ;
printf("** Third thread part 2 ** ) ;
}